home *** CD-ROM | disk | FTP | other *** search
- # Perl script to convert CR/NL, CR, NL/CR into NL
-
- die "Usage: NL in out\n" unless $#ARGV == 1;
-
- $* = 1; # Strings may contain NL
- undef $/; # Slurp the whole file
-
- open(IN,$ARGV[0]) || die "Cannot open $ARGV[0]: $!\n";
- open(OUT,">$ARGV[1]") || die "Cannot open $ARGV[1]: $!\n";
-
- $_ = <IN>;
-
- s/\r\n|\r|\n\r/\n/g;
-
- print OUT $_;
-